﻿'########################################################
'#    Nom ......... : Listing.vb
'#    Auteur ...... : L.CLAUDE
'#    Licence ..... : GPLV3
'########################################################



Friend Class Listing

    Sub New(ByVal table As String, ByVal colonne As String, ByRef combobox As ComboBox)

        

        If table = "marque" Then
            Dim Table_type_adaptater As New DatabaseCGDataSetTableAdapters.marqueTableAdapter
            Dim Table_type As New DatabaseCGDataSet.marqueDataTable

            'Appel de la méthode GetData de notre instance de TableAdapter pour le
            'remplissage de la table.
            Table_type = Table_type_adaptater.GetData


            For i = 0 To Table_type.Rows.Count - 1
                combobox.Items.Add(Table_type.Rows(i).Item(colonne))
            Next
        End If

        If table = "type_perif" Then
            Dim Table_type_adaptater As New DatabaseCGDataSetTableAdapters.type_perifTableAdapter
            Dim Table_type As New DatabaseCGDataSet.type_perifDataTable

            'Appel de la méthode GetData de notre instance de TableAdapter pour le
            'remplissage de la table.
            Table_type = Table_type_adaptater.GetData


            For i = 0 To Table_type.Rows.Count - 1
                combobox.Items.Add(Table_type.Rows(i).Item(colonne))
            Next
        End If

        If table = "velos" Then
            Dim Table_type_adaptater As New DatabaseCGDataSetTableAdapters.velosTableAdapter
            Dim Table_type As New DatabaseCGDataSet.velosDataTable

            'Appel de la méthode GetData de notre instance de TableAdapter pour le
            'remplissage de la table.
            Table_type = Table_type_adaptater.GetData


            For i = 0 To Table_type.Rows.Count - 1
                combobox.Items.Add(Table_type.Rows(i).Item(colonne))
            Next
        End If
        

    End Sub



End Class
